﻿using OOP.Strage.DesignPattern;

namespace OOP.SimpleFactory.DesignPattern
{
    public class PaymentStrategyFactory
    {
        public IPaymentStrategy Create(string paymentType)
        {
            return paymentType switch
            {
                "Alipay" => new AlipayStrategy(),
                "WechatPay" => new WechatPayStrategy(),
                _ => throw new ArgumentException("不支持的支付类型")
            };
        }
    }
}
